<template>
 <vxe-layout-container vertical>
   <vxe-layout-header class="layout-header">
    <Query :queryConfig="QueryConfig" @QueryEvent="handleQuery"></Query>
   </vxe-layout-header>
   <vxe-layout-body class="layout-body">
    <vxe-grid ref="maingrid" v-bind="GridOptions">
      <template #customButtons>
        <vxe-button status='primary' content='新增' :size="componentSize" @click="handleAdd"  v-if="btnPromission.add.buttonCaption"/>
        <vxe-button status='success' content='批量审核' :size="componentSize" @click="handleBatchAudit"  v-if="btnPromission.audit.buttonCaption"/>
        <vxe-button status='danger' content='批量删除' :size="componentSize" @click="handleBatchDelete" v-if="btnPromission.delete.buttonCaption"/>        
        <vxe-button status='default' icon="vxe-icon-upload" content='初始导入' :size="componentSize" @click="handleImport"  v-if="btnPromission.add.buttonCaption"/>
      </template>
      <template #operation="{ row }">
        <vxe-button :size="componentSize" mode="text" status="primary" content="编辑" @click="handleEdit(row)" v-if="btnPromission.edit.buttonCaption"/> 
        <vxe-button :size="componentSize" mode="text"  status="success" content="审核" @click="handleAudit(row)" v-if="btnPromission.audit.buttonCaption"/>
        <vxe-button :size="componentSize" mode="text"  status="danger" content="删除" @click="handleDelete(row)" v-if="btnPromission.delete.buttonCaption"/>
      </template>
      <template #auditStatus="{row}">
        <vxe-tag v-if="row.shzt == 'N'" status = 'error' content="未审核"></vxe-tag>
        <vxe-tag v-else status = 'success' content="已审核"></vxe-tag>
      </template>
    </vxe-grid>
   </vxe-layout-body>  
   <vxe-layout-footer class="layout-footer">
    <vxe-pager :align="PagerConfig.align" :size="componentSize" :current-page.sync="PagerConfig.currentPage"
    :page-size.sync="PagerConfig.pageSize" :total="PagerConfig.total" @page-change="handlePageChange"></vxe-pager>
   </vxe-layout-footer>
   <!--数据编辑窗口-->
   <vxe-modal v-model="editModal" title="数据编辑" :width="1120" :height="850">
      <vxe-form ref="editForm" v-bind="FormOptions" @submit="handleEditModalSubmit" @reset="handleEditModalReset">
        <template #action>
          <vxe-button type="submit" status="primary">提交</vxe-button>
          <vxe-button type="reset">重置</vxe-button>
          <vxe-button @click="handleImportProjectInfo">导入</vxe-button>
        </template>
      </vxe-form>
    </vxe-modal>
    <!--数据导入窗口-->
    <vxe-modal title="数据导入" show-footer show-confirm-button v-model="importModal" confirm-button-text="导入" :width="1200" :height="680"
      @confirm="handleImprotConfirm">
      <vxe-grid ref="importModalGrid" v-bind="ImportGridOptions">      
    </vxe-grid>
    </vxe-modal>
  </vxe-layout-container>

</template>
<style>
 
</style>
<script>
  import ProjectInfo from './index.js';
  export default ProjectInfo;
</script>

